package com.hexiang.rocketmq.mq.producer;

import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class OnewayProducer {

	@Resource
	private RocketMQTemplate rocketMQTemplate;

	public void sendOneway(String msgBody) {
		rocketMQTemplate.sendOneWay("TopicTest", MessageBuilder.withPayload(msgBody).build());

	}
}